/*
  ! 如果没有天赋，那就一直重复
  ! Created: 2024/06/15 09:26:35
*/
#include <bits/stdc++.h>
using namespace std;

#define x first
#define y second
// #define int long long
#define mp(x, y) make_pair(x, y)
#define eb(...) emplace_back(__VA_ARGS__)
#define fro(i, x, y) for (int i = (x); i <= (y); i++)
#define pre(i, x, y) for (int i = (x); i >= (y); i--)
inline void JYFILE19();

using i64 = long long;
using PII = pair<int, int>;

bool ST;
const int N = 1e6 + 10;
const int I = 38;
const int mod = 998244353;

int n, m, f[N], d[10], A[500][500], B[500][500];
string s;
vector<char> ans;
vector<char> res;
int Q, X, Y, L, R;
int vx[] = {-1, 1, 0, 0};
int vy[] = {0, 0, -1, 1};
char c[] = {'U', 'D', 'L', 'R'};

inline int rnd(int x) {
  int y = rand() % 3 + 1;
  while (x == y) y = rand() % 3 + 1;
  return y;
}
inline void sol(int x, int y, int a, int b) {
  int c = 6 - a - b;
  fro(i, 1, I) {
    if (i % 6 == 1 || i % 6 == 2) {
      A[x][i] = a;
      A[y][i] = b;
    } else if (i % 6 == 3 || i % 6 == 0) {
      A[x][i] = c;
      A[y][i] = c;
    } else {
      A[x][i] = b;
      A[y][i] = a;
    }
  }
}
inline void sol() {
  ans.clear();
  memset(A, 0, sizeof A);
  int l = 100, r = 101;
  int x = 100, y = (rand() % (I / 6)) * 6 + 1, q = y;
  sol(l, r, f[1], rnd(f[1]));
  fro(i, 2, n) {
    bool flag = 0;
    if (x < 100) d[0] = 1, d[2] = 0;
    if (x > 100) d[0] = 0, d[2] = 1;
    if (x == 100) {
      d[0] = 1, d[2] = 0;
      if (rand() & 1) swap(d[0], d[2]);
    } {
      d[1] = 2, d[3] = 3;
      if (rand() & 1) swap(d[1], d[3]);
    }
    if (rand() & 1) swap(d[0], d[1]);
    if (rand() & 1) swap(d[2], d[3]);
    fro(j, 0, 3) {
      int dx = x + vx[d[j]];
      int dy = y + vy[d[j]];
      if (1 <= dy && dy <= I) {
        if (l <= dx && dx <= r) {
          if (A[dx][dy] == f[i]) {
            flag = 1;
            ans.eb(c[d[j]]);
            x = dx, y = dy;
            break;
          }
        }
      }
    }
    if (flag == 0) {
      if (y == 1 && x == l) sol(l - 2, l - 1, 6 - f[i] - A[x][y], f[i]), l -= 2;
      else if (y == 1 && x == r) sol(r + 1, r + 2, f[i], 6 - f[i] - A[x][y]), r += 2;
      else if (y == I && x == l) sol(l - 2, l - 1, 6 - f[i] - A[x][y], f[i]), l -= 2;
      else if (y == I && x == r) sol(r + 1, r + 2, f[i], 6 - f[i] - A[x][y]), r += 2;
      fro(j, 0, 3) {
        int dx = x + vx[d[j]];
        int dy = y + vy[d[j]];
        if (1 <= dy && dy <= I) {
          if (l <= dx && dx <= r) {
            if (A[dx][dy] == f[i]) {
              flag = 1;
              ans.eb(c[d[j]]);
              x = dx, y = dy;
              break;
            }
          }
        }
      }
    }
  }
  if (R - L > r - l) {
    R = r, L = l, res = ans, Q = q;
    fro(i, l, r) {
      fro(j, 1, I) {
        B[i][j] = A[i][j];
      }
    }
  }
}

signed main() {
  JYFILE19();
  cin >> s, n = s.length();
  fro(i, 0, s.length() - 1) {
    if (s[i] == 'R') f[i + 1] = 1;
    if (s[i] == 'G') f[i + 1] = 2;
    if (s[i] == 'B') f[i + 1] = 3;
  }
  L = 0, R = 1e9;
  while (1.0 * clock() / CLOCKS_PER_SEC < 0.8) sol();
  cout << R - L + 1 << " " << I << "\n";
  fro(i, L, R) {
    fro(j, 1, I) {
      if (B[i][j] == 1) cout << 'R';
      if (B[i][j] == 2) cout << 'G';
      if (B[i][j] == 3) cout << 'B';
    }
    cout << "\n";
  }
  cout << 100 - L + 1 << " " << Q << "\n";
  for (auto i : res) cout << i;
  return 0;
}

bool ED;
inline void JYFILE19() {
  freopen("snake.in", "r", stdin);
  freopen("snake.out", "w", stdout);
  srand(random_device{}());
  ios::sync_with_stdio(0), cin.tie(0);
  double MIB = fabs((&ED - &ST) / 1048576.), LIM = I;
  cerr << "MEMORY: " << MIB << endl, assert(MIB <= LIM);
}